package marlon.sjf;

public class Command {
	String name;
	String[] args;
	String cwd;
	
	public Command(String name, String[] args, String cwd) {
		this.name = name;
		this.args = args;
		this.cwd = cwd;
	}
	
	public String getName() {
		return name;
	}
	
	public String[] getArgs() {
		return args;
	}
	
	public String getCwd() {
		return cwd;
	}
	
	public String toString() {
		return String.format("%s %s @%s", name, arrStr(args), cwd);
	}
	
	private static String arrStr(String[] strs) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < strs.length; i++) {
			sb.append(strs[i]);
			if (i < strs.length - 1)
				sb.append(" ");
		}
		return sb.toString();
	}
}